[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
getfat() Get File Allocation Table Information
#include <dos.h>
void getfat(drive,fatblkp);
unsigned char drive; Specified drive
struct fatinfo *fatblkp; Pointer to structure
getfat() gets information from the file allocation table for 'drive'.
The information is stored in the 'fatinfo' structure pointed to by
'fatblkp'. 'drive' is specified as 0 for the default, 1 for drive A,
2 for drive B, and so on. The 'fatinfo' structure is defined as:
struct fatinfo {
char fi_sclus; /* Sectors per cluster */
char fi_fatid; /* The FAT id byte */
int fi_nclus; /* Number of clusters */
int fi_bysec; /* Bytes per sector */
};
Returns: Nothing
Portability: MS-DOS only.
-------------------------------- Example ---------------------------------
The following statements get the file allocation table information
for drive A: and reports the number of bytes on the disk.
#include <stdio.h>
#include <dos.h>
main()
{
long drivebytes;
struct fatinfo finfo;
getfat(1, &finfo);
drivebytes = finfo.fi_nclus;
drivebytes *= finfo.fi_sclus;
drivebytes *= finfo.fi_bysec;
printf("Drive A: has %ld bytes\n", drivebytes);
}
See Also:
getdfree()
getfatd()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson